package com.bw.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.bw.config.Result;
import com.bw.domain.TraceTransport;
import com.bw.service.TraceTransportService;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/retail")
public class RetailController {
    @Autowired
    TraceTransportService traceTransportService;

    @RequestMapping("/listRetail")
    public Result listRetail(Page page,String cropsId, String cropsName){
        IPage<TraceTransport> list=traceTransportService.listReatil(page,cropsId,cropsName);
        return Result.ok(list);
    }

    @RequestMapping("/updateStatus")
    public Result updateStatus(Integer id){
        traceTransportService.updateStatus(id);
        return Result.ok();
    }

}
